CREATE PROCEDURE [KS_PKGDAdd]
@PKID int=0,
@UserName nvarchar(50),
@UserID int=0,
@Content ntext,
@UserIP nvarchar(50),
@Status tinyint=0,
@Adddate smalldatetime,
@Role   tinyint=0
 AS
  Insert Into [KS_PKGD](PKID,UserName,UserID,Content,UserIP,Status,AddDate,Role)
  values(@PKID,@UserName,@UserID,@Content,@UserIP,@Status,@AddDate,@Role)
  If @Role=1
   Update KS_PKZT Set ZFVotes=ZFVotes+1 Where PKID=@PKID
  Else If @Role=2
   Update KS_PKZT Set FFVotes=FFVotes+1 Where PKID=@PKID
  Else
   Update KS_PKZT Set SFVotes=SFVotes+1 Where PKID=@PKID